import request from '@/utils/request'

// 商户列表
export function merchantList(data) {
  return request({
    url: '/general_admin/v1/merchant/list',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 添加商户
export function addMerchant(data) {
  return request({
    url: '/general_admin/v1/merchant/create',
    method: 'post',
    data
  })
}

// 更新商户
export function updateMerchant(data) {
  return request({
    url: '/general_admin/v1/merchant/update',
    method: 'post',
    data
  })
}

// 删除商户
export function deleteMerchant(data) {
  return request({
    url: '/general_admin/v1/merchant/delete',
    method: 'get',
    params: {
      ...data
    }
  })
}

//刷新商户apiKey
export function updateApiKey(data) {
  return request({
    url: '/general_admin/v1/merchant/update-apikey',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 商户上游平台列表
export function upstreamPlatFormList(data) {
  return request({
    url: '/general_admin/v1/upstream-platform/list',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 商户上游平台配置列表
export function upstreamPlatFormConfigList(data) {
  return request({
    url: '/general_admin/v1/merchant/merchant-upstream-config-list',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 添加商户上游平台配置
export function createUpstreamConfig(data) {
  return request({
    url: '/general_admin/v1/merchant/create-upstream-config',
    method: 'post',
    data
  })
}

// 更新商户上游平台配置
export function updateUpstreamConfig(data) {
  return request({
    url: '/general_admin/v1/merchant/update-upstream-config',
    method: 'post',
    data
  })
}

// 删除商户上游平台配置
export function deleteUpstreamConfig(data) {
  return request({
    url: '/general_admin/v1/merchant/delete-upstream-config',
    method: 'get',
    params: {
      ...data
    }
  })
}


// 商户下拉选择列表
export function merchantSelectList(data) {
  return request({
    url: '/general_admin/v1/merchant/select-list',
    method: 'get',
  })
}

// webhook配置列表
export function webhookConfigList(data) {
  return request({
    url: '/general_admin/v1/webhook-config/list',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 添加webhook配置
export function createWebhookConfig(data) {
  return request({
    url: '/general_admin/v1/webhook-config/create',
    method: 'post',
    data
  })
}

// 删除webhook配置
export function deleteWebhookConfig(data) {
  return request({
    url: '/general_admin/v1/webhook-config/delete',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 更新webhook配置
export function updateWebhookConfig(data) {
  return request({
    url: '/general_admin/v1/webhook-config/update',
    method: 'post',
    data: {
      ...data
    }
  })
}
// banking-av账户信息列表
export function bankingAvInfoList(data) {
  return request({
    url: '/general_admin/v1/merchant/bank-av-info-list',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 新增banking-av账户信息
export function createBankingAvInfo(data) {
  return request({
    url: '/general_admin/v1/merchant/create-bank-av-info',
    method: 'post',
    data: {
      ...data
    }
  })
}

// 更新banking-av账户信息
export function updateBankingAvInfo(data) {
  return request({
    url: '/general_admin/v1/merchant/update-bank-av-info',
    method: 'post',
    data: {
      ...data
    }
  })
}

// 银行账户互转
export function upBankToBank(data) {
  return request({
    url: '/general_admin/v1/merchant-platform-balance/uq-bank-to-bank',
    method: 'post',
    data: {
      ...data
    }
  })
}

// banking转账列表
export function bankingTransferList(data) {
  return request({
    url: '/general_admin/v1/merchant/banking-transfer-list',
    method: 'get',
    params: {
      ...data
    }
  })
}

// 创建上游平台
export function createUpstreamPlatform(data) {
  return request({
    url: '/general_admin/v1/upstream-platform/create',
    method: 'post',
    data: {
      ...data
    }
  })
}

// 更新上游平台
export function updateUpstreamPlatform(data) {
  return request({
    url: '/general_admin/v1/upstream-platform/update',
    method: 'post',
    data: {
      ...data
    }
  })
}

// banking互转接收账户列表
export function bankingReceiveList(data) {
  return request({
    url: '/general_admin/v1/merchant-platform-balance/uq-beneficiary-list',
    method: 'get',
    params: {
      ...data
    }
  })
}

export function deleteUpBeneficiary(data) {
  return request({
    url: '/general_admin/v1/merchant-platform-balance/uq-beneficiary-delete',
    method: 'post',
    data: {
      ...data
    }
  })
}

// issuing账户账单列表
export function issuingBillList(data) {
  return request({
    url: '/general_admin/v1/merchant-platform-balance/issuing-balance-transaction-list',
    method: 'get',
    params: {
      ...data
    }
  })
}

// issuing账户信息列表
export function issuingInfoList(data) {
  return request({
    url: '/general_admin/v1/merchant-platform-balance/issuing-balance',
    method: 'get',
    params: {
      ...data
    }
  })
}